﻿@model Forum.Models.PostDetailModel

@{
    ViewBag.Title = "PostDetail";
}
<h1>@Model.Title</h1>
<h6>Published by: @Model.AuthorUsername at @Model.DatePublished</h6>
<div>
    @Model.Content
</div>
@if (@Model.Answers!=null)
{
    <ul>
        @foreach (var answer in @Model.Answers)
        {
            <li>
                <div>@answer.Content</div>
                <div>Published at @answer.DatePublished by @answer.AuthorUsername</div>
            </li>
        }
    </ul>
}

@Html.ActionLink("Answer this post", "CreateAnswer", "Answer", new { id = @Model.Id }, null)
